package com.butterfly.webserver;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by DouDou on 2016/9/20.
 */
public class WebServer {

    public WebServer() {
    }

    public void start(int port){
        try {

            ServerSocket serverSocket = new ServerSocket(port);

            while (true) {
                Socket socket = serverSocket.accept();
                new Process(socket).start();
            }
        }catch(Exception e){
            e.printStackTrace();
        }
    }
}
